// *Author：jxx
// *Contact：283591387@qq.com
// *代码由框架生成,任何更改都可能导致被代码生成器覆盖
export default function(){
    const table = {
        key: 'order_id',
        footer: "Foots",
        cnName: '订单表',
        name: 'so_order',
        url: "/so_order/",
        sortName: "order_id"
    };
    const tableName = table.name;
    const tableCNName = table.cnName;
    const newTabEdit = false;
    const key = table.key;
    const editFormFields = {"order_name":"","customer_id":"","order_status":1,"CreateTime":"","total_amount":0,"shipping_address":"","ordernoas":"","Num":"","unit_price":""};
    
    // 订单状态字典配置
    const orderStatusOptions = [
        { key: 1, value: '已创建' },
        { key: 2, value: '已发货' },
        { key: 3, value: '已完成' },
        { key: 0, value: '已取消' }
    ];
    
    const editFormOptions = [[{"title":"订单编号","field":"ordernoas","type":"text","disabled":true},
                              {"title":"商品名称","field":"order_name","type":"text","require":true}],
                             [{"dataKey":"用户列表","data":[],"title":"客户名称","field":"customer_id","type":"select"},
                              {"title":"创建时间","field":"CreateTime","type":"datetime","disabled":true}],
                             [{"title":"单价","field":"unit_price","type":"decimal","require":true},
                              {"title":"数量","field":"Num","type":"number","require":true}],
                             [{"title":"订单金额","field":"total_amount","type":"decimal","disabled":true},
                              {"title":"订单地址","field":"shipping_address","type":"text"}]];
    const searchFormFields = {};
    const searchFormOptions = [];

    const columns = [{field:'order_id',title:'主键ID',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'order_name',title:'商品名称',type:'string',width:110,align:'left',sort:true},
                       {field:'customer_id',title:'客户名称',type:'int',bind:{ key:'用户列表',data:[]},width:110,align:'left'},
                       {field:'order_status',title:'订单状态',type:'sbyte',bind:{ key:'订单状态',data:orderStatusOptions},width:110,align:'left'},
                       {field:'CreateTime',title:'创建时间',type:'datetime',width:150,align:'left',sort:true},
                       {field:'total_amount',title:'订单金额',type:'decimal',width:110,align:'left'},
                       {field:'shipping_address',title:'订单地址',type:'string',width:110,align:'left'},
                       {field:'ordernoas',title:'订单编号',type:'string',width:120,align:'left'},
                       {field:'Num',title:'数量',type:'int',width:120,align:'left'},
                       {field:'unit_price',title:'单价',type:'decimal',width:120,align:'left'}];
    const detail ={columns:[]};
    const details = [];

    return {
        table,
        key,
        tableName,
        tableCNName,
        newTabEdit,
        editFormFields,
        editFormOptions,
        searchFormFields,
        searchFormOptions,
        columns,
        detail,
        details
    };
}